package com.nmsl.system.presc_temp.service.impl;

import com.nmsl.system.presc_temp.domain.PrescriptionMedicine;
import com.nmsl.system.presc_temp.mapper.PrescriptionMedicineMapper;
import com.nmsl.system.presc_temp.service.IPrescriptionMedicineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service
public class PrescriptionMedicineServiceImpl implements IPrescriptionMedicineService {


    @Autowired
    private PrescriptionMedicineMapper prescriptionMedicineMapper;

    @Override
    public List<PrescriptionMedicine> getAllPrescriptionMedicines() {
        return prescriptionMedicineMapper.getAllPrescriptionMedicines();
    }

    @Override
    public int insertPrescriptionMedicines(List<PrescriptionMedicine> prescriptionMedicines) {
        for (PrescriptionMedicine prescriptionMedicine : prescriptionMedicines) {
            System.out.println(prescriptionMedicine);
        }
        return 0;
    }

    @Override
    public int insert(PrescriptionMedicine prescriptionMedicine) {
        return prescriptionMedicineMapper.insert(prescriptionMedicine);
    }

    @Override
    public int delete(Long visitRecordId) {
        return prescriptionMedicineMapper.deletePrescriptionMedicine(visitRecordId);
    }
}